#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Action.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class InputPin;

/// <summary>
/// DestroyObjectAction
/// A DestroyObjectAction is an Action that destroys objects.
/// </summary>
class UMLMODEL_EXPORT DestroyObjectAction : public Action {

public: // Constructors and destructors
    explicit DestroyObjectAction(const QString& umlType="uml::DestroyObjectAction");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// isDestroyLinks getter
    /// Specifies whether links in which the object participates are destroyed along
    /// with the object.
    /// </summary>
    bool isDestroyLinks() const;

    /// <summary>
    /// isDestroyLinks setter
    /// Specifies whether links in which the object participates are destroyed along
    /// with the object.
    /// </summary>
    void setIsDestroyLinks(bool value);

    /// <summary>
    /// isDestroyOwnedObjects getter
    /// Specifies whether objects owned by the object (via composition) are destroyed
    /// along with the object.
    /// </summary>
    bool isDestroyOwnedObjects() const;

    /// <summary>
    /// isDestroyOwnedObjects setter
    /// Specifies whether objects owned by the object (via composition) are destroyed
    /// along with the object.
    /// </summary>
    void setIsDestroyOwnedObjects(bool value);

    /// <summary>
    /// target getter
    /// The InputPin providing the object to be destroyed.
    /// </summary>
    shared_ptr<InputPin> target() const;

    /// <summary>
    /// target setter
    /// The InputPin providing the object to be destroyed.
    /// </summary>
    void setTarget(shared_ptr<InputPin> value);

private: // Fields
    /// <summary>
    /// isDestroyLinks
    /// Specifies whether links in which the object participates are destroyed along
    /// with the object.
    /// </summary>
    const static bool isDestroyLinks_default_;
    bool isDestroyLinks_= isDestroyLinks_default_;

    /// <summary>
    /// isDestroyOwnedObjects
    /// Specifies whether objects owned by the object (via composition) are destroyed
    /// along with the object.
    /// </summary>
    const static bool isDestroyOwnedObjects_default_;
    bool isDestroyOwnedObjects_= isDestroyOwnedObjects_default_;

    /// <summary>
    /// target
    /// The InputPin providing the object to be destroyed.
    /// </summary>
    shared_ptr<InputPin> target_;

};

} // namespace uml
